home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
et
/
et3_0-a1.lha
/
et3
/
src
/
FileBuf.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-05-08
|
880b
|
40 lines
#ifndef Filebuf_First
#ifdef __GNUG__
//pragma once
#pragma interface
#endif
#define Filebuf_First
#include "StreamBuf.h"
enum open_mode { input= 0, output= 1, append= 2 };
//---- Filebuf -----------------------------------------------------------------
class Filebuf : public StreamBuf { // a Stream buffer for files
int fd; // file descriptor
bool opened; // non-zero if file has been opened
bool mapped;
public:
Filebuf();
Filebuf(int nfd);
Filebuf(int nfd, char* p, int l);
Filebuf(char *path, open_mode m);
~Filebuf();
bool isopen()
{ return opened; }
// Open a file. return 0 if failure; return "this" if success
Filebuf* open(char *name, open_mode om);
bool close();
int Overflow(u_char *bp, int size);
int Underflow(u_char *p, int l);
long Seek(long pos, int whence);
};
#endif